<?php
// 本类由系统自动生成，仅供测试用途
namespace Admin\Controller;
use Think\Controller;
class AdddController extends CommonController {
    public function index(){
              $Data= M('goods');
              $result1= $Data->order('date desc')->select(); 
              $this->assign('page',$result1);//留言总数
             $this->display();
    }
    
     
  public function add()
     {        
         if(IS_POST){
    
              $m=M('goods');
             $data['pass']=$_POST['pass'];
             $data['name']=$_POST['name'];
             $data['comment']=$_POST['comment'];
               $data['down']=$_POST['down'];
             $data['type']=$_POST['type'];
             $data['date']=date('Y-m-d');
             $count=$m->add($data);
  
             if($count>0){
                $this->success('数据修改成功',U('addd/index'));
              }else{
                $this->error('数据修改失败');
              }
      }else{
      
      $this->error('非法操作！！！');
      }    
   }              
     
}